import Mock from 'mockjs'

const Random = Mock.Random

const userInfo = {
    url: '/user/login',
    type: 'post',
    response: (config: any) => {
        const result = Mock.mock({username: '@cname', age: Random.integer(60, 100), ID: "@id",token:'@guid'})
        return {
            status: 200,
            result: result
        }
    }

}

const menuInfo = {
    url: '/user/getMenu',
    type: 'post',
    response: (config: any) => {
        const result = Mock.mock([{
            name: 'home',
            path: "/index",//用于menu
            component:'home/index',//用于注册router
            exact:true,
            meta: {
                title: '首页',
                icon:'HomeOutlined',
            }
        }, {
            name:'test',
            path: "/test",
            component:'test/index',
            exact:true,
            meta: {
                title: '测试',
                icon:'LaptopOutlined',
            }
        }, {
            name:'bigScreen',
            path: "/bigScreen",
            component:'bigScreen/index',
            exact:true,
            meta: {
                title: '数据大屏',
            }
        }])
        return {
            status: 200,
            result: result
        }
    }

}

export default [
    userInfo, menuInfo
]
